package com.wjf.birdfish.util;

import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
import org.apache.log4j.Logger;


/*****
 * 读取需要刷新中心的配置文件的工具类
 * @author lzp
 *
 */
public class FreshSCTablesUtil {
	
	private static Logger LOG = Logger.getLogger(FreshSCTablesUtil.class
			.getName());
	
	
	private static ResourceBundle bundle = null;
	
	static {
		try {
			bundle = ResourceBundle.getBundle("freshSCTables");
		} catch (Exception e) {
			e.printStackTrace();
			LOG.error("load file freshSCTables.properties error." + e.getMessage());
		}
	}

	public static List<String> getTables(String key) {
		List<String> list = new ArrayList<String>();
		String value=bundle.getString(key);
		String[] tables = value.split(",");
		for(String table : tables){
			list.add(table);
		}
		return list;
	}
	
	
	public static void main(String[] args){
		System.out.println(getTables("1"));
	}
}
